package commonElements;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;

public class UserCabinetPage extends BasePage {

    public static final String PAGE_URL="/";
    public static final String USER_CABINET_URL="http://my.rozetka.com.ua";
    private By userTitle = By.className("m-user-title");

    public UserCabinetPage(WebDriver driver)
    {
        super(driver,  USER_CABINET_URL, PAGE_URL);
    }

    public void open()
    {
        driver.get(pageUrl);
    }

    public boolean isLogin (String user_name)
    {
        try{
        return driver.findElement(userTitle).getText().contains(user_name);
           }
        catch(Exception e)
        {  return false;}
    }
}
